<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .container {
            overflow: hidden;
            display: flex;
            justify-content: center;
            align-items: center;
            border:1px solid blue ;
            width: 200px;
            height:150px;
            position: relative;
        }

        .big-image {
            transition: opacity 0.3s ease;
            opacity: 1;
            object-fit: cover;
        }

        .big-image:hover {
            opacity: 0.5;
        }

        .big-image:hover + .small-image {
            display: block;
            cursor: pointer;
            opacity: 0.5;
        }

        .small-image {
            width: 20px;
            position: absolute;
            /*top: 50%; !* 垂直居中 *!*/
            /*left: 50%; !* 水平居中 *!*/
            /*transform: translate(-50%, -50%); !* 使用 transform 属性将小图在大图中心定位 *!*/
            display: none;
        }


    </style>
</head>
<body>

<div class="container">
    <img src="./imgs/大海001.jpg" alt="大海" class="big-image"/>
    <img src="./imgs/del.png" alt="del" class="small-image"/>
</div>

<script>
    document.querySelector('.del').addEventListener('click', function () {
        alert('删除')
    });

</script>
</body>
</html>
